/*********************************************************************
 
  (c) copyright Freescale Semiconductor Ltd. 2010
  ALL RIGHTS RESERVED
 
 ********************************************************************
 Ver 0	Initial release
 ********************************************************************/
/****************************************************************************
*                                                                           *
* C O N F I D E N T I A L                                                   *
*                                                                           *
* This code is released under the Non-Disclosure Agreement (NDA) between    *
* customer and Freescale, and is allowed to use in Freescale's products     *
* only                                                                      *
*                                                                           *
*****************************************************************************
* THIS  CODE IS ONLY INTENDED AS AN EXAMPLE FOR DEMONSTRATING THE FREESCALE *
* MICROCONTROLLERS.  IT  HAS ONLY BEEN GIVEN A MINIMUM LEVEL OF TEST. IT IS *
* PROVIDED  'AS  SEEN'  WITH  NO  GUARANTEES  AND  NO  PROMISE  OF SUPPORT. *
*****************************************************************************
*                                                                           *
*****************************************************************************
* Freescale  is  not  obligated  to  provide  any  support, upgrades or new *
* releases  of  the Software. Freescale may make changes to the Software at *
* any time, without any obligation to notify or provide updated versions of *
* the  Software  to you. Freescale expressly disclaims any warranty for the *
* Software.  The  Software is provided as is, without warranty of any kind, *
* either  express  or  implied,  including, without limitation, the implied *
* warranties  of  merchantability,  fitness  for  a  particular purpose, or *
* non-infringement.  You  assume  the entire risk arising out of the use or *
* performance of the Software, or any systems you design using the software *
* (if  any).  Nothing  may  be construed as a warranty or representation by *
* Freescale  that  the  Software  or  any derivative work developed with or *
* incorporating  the  Software  will  be  free  from  infringement  of  the *
* intellectual property rights of third parties. In no event will Freescale *
* be  liable,  whether in contract, tort, or otherwise, for any incidental, *
* special,  indirect, consequential or punitive damages, including, but not *
* limited  to,  damages  for  any loss of use, loss of time, inconvenience, *
* commercial loss, or lost profits, savings, or revenues to the full extent *
* such  may be disclaimed by law. The Software is not fault tolerant and is *
* not  designed,  manufactured  or  intended by Freescale for incorporation *
* into  products intended for use or resale in on-line control equipment in *
* hazardous, dangerous to life or potentially life-threatening environments *
* requiring  fail-safe  performance,  such  as  in the operation of nuclear *
* facilities,  aircraft  navigation  or  communication systems, air traffic *
* control,  direct  life  support machines or weapons systems, in which the *
* failure  of  products  could  lead  directly to death, personal injury or *
* severe  physical  or  environmental  damage  (High  Risk Activities). You *
* specifically  represent and warrant that you will not use the Software or *
* any  derivative  work of the Software for High Risk Activities.           *
* Freescale  and the Freescale logos are registered trademarks of Freescale *
* Semiconductor Inc.                                                        *
****************************************************************************/



#ifndef _MMA8452Q_H
#define _MMA8452Q_H

#define MMA8452Q_ADD   0x1C    //Please contact the factory to request a different IIC address
//#define MMA8452Q_ADD   0x1D

// IIC Register Address
#define MMA8452_STATUS              0x00
#define MMA8452_STATUS1             0x00
#define MMA8452_X_MSB               0x01
#define MMA8452_X_LSB               0x02
#define MMA8452_Y_MSB               0x03
#define MMA8452_Y_LSB               0x04
#define MMA8452_Z_MSB               0x05
#define MMA8452_Z_LSB               0x06
#define MMA8452_SYSMOD              0x0B
#define MMA8452_INT_SOURCE          0x0C
#define MMA8452_WHO_AM_I            0x0D
#define MMA8452_XYZ_DATA_CFG        0x0E
#define MMA8452_HP_FILTER_CUTOFF    0x0F
#define MMA8452_PL_STATUS           0x10
#define MMA8452_PL_CFG              0x11
#define MMA8452_PL_COUNT            0x12
#define MMA8452_PL_BF_ZCOMP         0x13
#define MMA8452_PL_THS_REG          0x14
#define MMA8452_FF_MT_CFG           0x15
#define MMA8452_FF_MT_SRC           0x16
#define MMA8452_FF_MT_THS           0x17
#define MMA8452_FF_MT_COUNT         0x18
#define MMA8452_TRANSIENT_CFG       0x1D
#define MMA8452_TRANSIENT_SRC       0x1E
#define MMA8452_TRANSIENT_THS       0x1F
#define MMA8452_TRANSIENT_COUNT     0x20
#define MMA8452_PULSE_CFG           0x21
#define MMA8452_PULSE_SRC           0x22
#define MMA8452_PULSE_THSX          0x23
#define MMA8452_PULSE_THSY          0x24
#define MMA8452_PULSE_THSZ          0x25
#define MMA8452_PULSE_TMLT          0x26
#define MMA8452_PULSE_LTCY          0x27
#define MMA8452_PULSE_WIND          0x28
#define MMA8452_ASLP_COUNT          0x29
#define MMA8452_CTRL_REG1           0x2A
#define MMA8452_CTRL_REG2           0x2B
#define MMA8452_CTRL_REG3           0x2C
#define MMA8452_CTRL_REG4           0x2D
#define MMA8452_CTRL_REG5           0x2E
#define MMA8452_OFF_X               0x2F
#define MMA8452_OFF_Y               0x30
#define MMA8452_OFF_Z               0x31

#define MMA8452_INT_MASK_DRDY       0x01
#define MMA8452_INT_MASK_FF_MT      0x04
#define MMA8452_INT_MASK_PULSE      0x08
#define MMA8452_INT_MASK_LNDPRT     0x10
#define MMA8452_INT_MASK_TRANS      0x20
#define MMA8452_INT_MASK_ASLP       0x80

#endif